package edu.je.prs.util;

import cn.hutool.core.io.resource.ClassPathResource;
import com.alibaba.fastjson.JSON;
import com.junqson.je.common.constant.AppRedisKey;
import edu.je.prs.Model.CityInfo.City;
import edu.je.prs.Model.CityInfo.Province;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.List;

/**
 * @Description:
 * @author: Anhlaidh
 * @date: 2021-03-30 15:04
 */
@Component
@Order(1)
public class AutoRun implements ApplicationRunner {
    static final String Popularity = "[{\"name\": [\"eclipse\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"git\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"greenplum\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"hibernate\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"idea\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"java\"] ,\"value\": 0.868421052631579 },{\"name\": [\"maven\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"mybatis\"] ,\"value\": 0.3684210526315789 },{\"name\": [\"mysql\"] ,\"value\": 0.631578947368421 },{\"name\": [\"oracle\"] ,\"value\": 0.4473684210526316 },{\"name\": [\"postagesql\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"scala\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"server\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"springboot\"] ,\"value\": 0.3157894736842105 },{\"name\": [\"springmvc\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"sql\"] ,\"value\": 0.2894736842105263 },{\"name\": [\"tomcat\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"ibatis\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"j2ee\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"linux\"] ,\"value\": 0.3157894736842105 },{\"name\": [\"sqlserver\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"struts2\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"uml\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"unix\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"weblogic\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"eas\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"struts\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"b\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"com\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"hr\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"shipping\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"sitc\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"u\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"\\\\\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"bpm\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"html\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"javascript\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"oa\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"sap\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"Springcloud\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"http\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"https\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"nosql\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"web\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"hive\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"kafka\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"mvc\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"o2o\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"redis\"] ,\"value\": 0.47368421052631576 },{\"name\": [\"zookeeper\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"c\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"c++\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"erlang\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"ip\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"tcp\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"Springboot\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"Springsecurity\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"apachekafka\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"api\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"cassandra\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"cucumber\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"intellij\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"jenkins\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"jmeter\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"junit\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"jvm\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"micro\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"mocks\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"restapi\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"services\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"springjdbc\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"unixshell\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"devops\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"docker\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"k8s\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"mongodb\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"springcloud\"] ,\"value\": 0.2894736842105263 },{\"name\": [\"oop\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"rabbitmq\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"rocketmq\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"ssh\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"ajax\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"bi\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"erp\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"h5\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"js\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"mes\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"svn\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"vue\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"wms\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"code\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"review\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"apollo\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"dubbo\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"elasticsearch\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"gc\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"nacos\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"prometheus\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"es\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"it\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"kubernate\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"bug\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"cuizhuqing\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"restful\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"Springcore\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"jetty\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"nginx\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"saas\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"activiti\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"ddl\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"dml\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"mq\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"coud\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"jq\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"ssm\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"was\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"scrum\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"jdbc\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"io\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"ee\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"memcached\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"apache\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"css\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"jquery\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"codereview\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"oms\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"tms\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"rpc\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"dhtml\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"javaee\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"jboss\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"s\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"script\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"webservice\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"webwork\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"xml\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"mycat\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"easyui\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"html5\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"css3\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"db2\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"javabean\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"jsp\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"servlet\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"angularjs\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"element\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"iview\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"mac\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"os\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"share\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"ui\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"access\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"sqlite\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"windows\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"java\", \"mybatis\"] ,\"value\": 0.34210526315789475 },{\"name\": [\"java\", \"mysql\"] ,\"value\": 0.5789473684210527 },{\"name\": [\"java\", \"oracle\"] ,\"value\": 0.42105263157894735 },{\"name\": [\"java\", \"springboot\"] ,\"value\": 0.2894736842105263 },{\"name\": [\"java\", \"sql\"] ,\"value\": 0.2894736842105263 },{\"name\": [\"mysql\", \"mybatis\"] ,\"value\": 0.23684210526315788 },{\"name\": [\"oracle\", \"mybatis\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"springboot\", \"mybatis\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"sql\", \"mybatis\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"oracle\", \"mysql\"] ,\"value\": 0.3684210526315789 },{\"name\": [\"springboot\", \"mysql\"] ,\"value\": 0.23684210526315788 },{\"name\": [\"sql\", \"mysql\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"oracle\", \"springboot\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"oracle\", \"sql\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"springboot\", \"sql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"linux\"] ,\"value\": 0.3157894736842105 },{\"name\": [\"oracle\", \"linux\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"sql\", \"linux\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"java\", \"nosql\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"java\", \"web\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"nosql\", \"sql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"web\", \"sql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"web\", \"nosql\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"java\", \"redis\"] ,\"value\": 0.4473684210526316 },{\"name\": [\"nosql\", \"mysql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"redis\", \"mysql\"] ,\"value\": 0.4473684210526316 },{\"name\": [\"redis\", \"nosql\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"nosql\", \"mybatis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"redis\", \"mybatis\"] ,\"value\": 0.23684210526315788 },{\"name\": [\"springcloud\", \"mybatis\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"springcloud\", \"mysql\"] ,\"value\": 0.23684210526315788 },{\"name\": [\"oracle\", \"nosql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"oracle\", \"redis\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"oracle\", \"springcloud\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"springboot\", \"nosql\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"springboot\", \"redis\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"springboot\", \"springcloud\"] ,\"value\": 0.23684210526315788 },{\"name\": [\"springcloud\", \"nosql\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"springcloud\", \"redis\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"java\", \"springcloud\"] ,\"value\": 0.2631578947368421 },{\"name\": [\"web\", \"mysql\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"oracle\", \"web\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"springboot\", \"web\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"springcloud\", \"web\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"java\", \"dubbo\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"dubbo\", \"mysql\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"oracle\", \"dubbo\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"redis\", \"sql\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"springcloud\", \"sql\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"dubbo\", \"sql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"nosql\", \"dubbo\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"redis\", \"dubbo\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"springcloud\", \"dubbo\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"web\", \"mybatis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"linux\", \"mybatis\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"linux\", \"mysql\"] ,\"value\": 0.23684210526315788 },{\"name\": [\"redis\", \"linux\"] ,\"value\": 0.2631578947368421 },{\"name\": [\"web\", \"linux\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"dubbo\", \"linux\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"web\", \"redis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"web\", \"dubbo\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"springboot\", \"linux\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"springcloud\", \"linux\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"dubbo\", \"mybatis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"springboot\", \"dubbo\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"nosql\", \"linux\"] ,\"value\": 0.02631578947368421 },{\"name\": [\"java\", \"mysql\", \"mybatis\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"java\", \"oracle\", \"mybatis\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"java\", \"springboot\", \"mybatis\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"java\", \"sql\", \"mybatis\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"java\", \"oracle\", \"mysql\"] ,\"value\": 0.34210526315789475 },{\"name\": [\"java\", \"springboot\", \"mysql\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"java\", \"sql\", \"mysql\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"java\", \"springboot\", \"oracle\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"java\", \"oracle\", \"sql\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"java\", \"springboot\", \"sql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"oracle\", \"mysql\", \"mybatis\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"springboot\", \"mysql\", \"mybatis\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"oracle\", \"springboot\", \"mysql\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"java\", \"oracle\", \"linux\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"java\", \"sql\", \"linux\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"java\", \"web\", \"sql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"redis\", \"mysql\"] ,\"value\": 0.42105263157894735 },{\"name\": [\"mysql\", \"redis\", \"mybatis\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"mysql\", \"springcloud\", \"mybatis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"oracle\", \"redis\", \"mysql\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"oracle\", \"springcloud\", \"mysql\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"springboot\", \"redis\", \"mysql\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"springboot\", \"springcloud\", \"mysql\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"springcloud\", \"redis\", \"mysql\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"oracle\", \"redis\", \"mybatis\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"springboot\", \"redis\", \"mybatis\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"springcloud\", \"redis\", \"mybatis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"oracle\", \"springboot\", \"redis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"oracle\", \"springcloud\", \"redis\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"springboot\", \"springcloud\", \"redis\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"java\", \"web\", \"mysql\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"java\", \"springcloud\", \"mysql\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"java\", \"web\", \"oracle\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"springcloud\", \"oracle\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"java\", \"springboot\", \"web\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"springboot\", \"springcloud\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"java\", \"springcloud\", \"web\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"java\", \"dubbo\", \"mysql\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"java\", \"redis\", \"oracle\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"java\", \"oracle\", \"dubbo\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"java\", \"redis\", \"sql\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"java\", \"springcloud\", \"sql\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"java\", \"dubbo\", \"sql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"springcloud\", \"redis\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"java\", \"redis\", \"dubbo\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"java\", \"springcloud\", \"dubbo\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"java\", \"web\", \"mybatis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"redis\", \"mybatis\"] ,\"value\": 0.21052631578947367 },{\"name\": [\"java\", \"linux\", \"mybatis\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"java\", \"linux\", \"mysql\"] ,\"value\": 0.23684210526315788 },{\"name\": [\"mysql\", \"linux\", \"mybatis\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"oracle\", \"linux\", \"mysql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"redis\", \"linux\"] ,\"value\": 0.2631578947368421 },{\"name\": [\"redis\", \"linux\", \"mysql\"] ,\"value\": 0.23684210526315788 },{\"name\": [\"redis\", \"linux\", \"mybatis\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"oracle\", \"redis\", \"linux\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"web\", \"linux\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"dubbo\", \"linux\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"java\", \"web\", \"redis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"web\", \"dubbo\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"java\", \"springcloud\", \"mybatis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"springboot\", \"linux\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"java\", \"springboot\", \"redis\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"springboot\", \"linux\", \"mysql\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"java\", \"springcloud\", \"linux\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"springcloud\", \"linux\", \"mysql\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"springboot\", \"redis\", \"linux\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"springcloud\", \"redis\", \"linux\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"dubbo\", \"mybatis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"java\", \"springboot\", \"dubbo\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"oracle\", \"mysql\", \"java\", \"mybatis\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"mysql\", \"java\", \"springboot\", \"mybatis\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"oracle\", \"mysql\", \"java\", \"springboot\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"oracle\", \"mysql\", \"redis\", \"mybatis\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"springcloud\", \"mysql\", \"redis\", \"mybatis\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"oracle\", \"springcloud\", \"mysql\", \"redis\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"oracle\", \"springcloud\", \"mysql\", \"java\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"springcloud\", \"mysql\", \"java\", \"springboot\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"oracle\", \"mysql\", \"java\", \"redis\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"springcloud\", \"mysql\", \"java\", \"redis\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"mysql\", \"java\", \"redis\", \"mybatis\"] ,\"value\": 0.18421052631578946 },{\"name\": [\"linux\", \"mysql\", \"java\", \"mybatis\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"oracle\", \"mysql\", \"java\", \"linux\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"mysql\", \"java\", \"redis\", \"linux\"] ,\"value\": 0.23684210526315788 },{\"name\": [\"linux\", \"mysql\", \"redis\", \"mybatis\"] ,\"value\": 0.13157894736842105 },{\"name\": [\"oracle\", \"mysql\", \"redis\", \"linux\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"linux\", \"java\", \"redis\", \"mybatis\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"springcloud\", \"mysql\", \"java\", \"mybatis\"] ,\"value\": 0.05263157894736842 },{\"name\": [\"mysql\", \"java\", \"springboot\", \"redis\"] ,\"value\": 0.15789473684210525 },{\"name\": [\"mysql\", \"java\", \"springboot\", \"linux\"] ,\"value\": 0.10526315789473684 },{\"name\": [\"springcloud\", \"mysql\", \"redis\", \"linux\"] ,\"value\": 0.07894736842105263 },{\"name\": [\"springcloud\", \"mysql\", \"java\", \"linux\"] ,\"value\": 0.07894736842105263 }]";
    static final String FrozenSet = "[{\"source\": [\"java\"] ,\"target\": [\"mybatis\"] ,\"value\": 0.9285714285714286 },{\"source\": [\"mybatis\"] ,\"target\": [\"java\"] ,\"value\": 0.3939393939393939 },{\"source\": [\"java\"] ,\"target\": [\"mysql\"] ,\"value\": 0.9166666666666667 },{\"source\": [\"mysql\"] ,\"target\": [\"java\"] ,\"value\": 0.6666666666666666 },{\"source\": [\"java\"] ,\"target\": [\"oracle\"] ,\"value\": 0.9411764705882353 },{\"source\": [\"oracle\"] ,\"target\": [\"java\"] ,\"value\": 0.4848484848484848 },{\"source\": [\"java\"] ,\"target\": [\"springboot\"] ,\"value\": 0.9166666666666667 },{\"source\": [\"springboot\"] ,\"target\": [\"java\"] ,\"value\": 0.3333333333333333 },{\"source\": [\"java\"] ,\"target\": [\"sql\"] ,\"value\": 1.0 },{\"source\": [\"sql\"] ,\"target\": [\"java\"] ,\"value\": 0.3333333333333333 },{\"source\": [\"mysql\"] ,\"target\": [\"mybatis\"] ,\"value\": 0.6428571428571429 },{\"source\": [\"mybatis\"] ,\"target\": [\"mysql\"] ,\"value\": 0.375 },{\"source\": [\"oracle\"] ,\"target\": [\"mysql\"] ,\"value\": 0.5833333333333334 },{\"source\": [\"mysql\"] ,\"target\": [\"oracle\"] ,\"value\": 0.8235294117647058 },{\"source\": [\"springboot\"] ,\"target\": [\"mysql\"] ,\"value\": 0.375 },{\"source\": [\"mysql\"] ,\"target\": [\"springboot\"] ,\"value\": 0.75 },{\"source\": [\"java\"] ,\"target\": [\"linux\"] ,\"value\": 1.0 },{\"source\": [\"linux\"] ,\"target\": [\"java\"] ,\"value\": 0.3636363636363636 },{\"source\": [\"java\"] ,\"target\": [\"web\"] ,\"value\": 1.0 },{\"source\": [\"java\"] ,\"target\": [\"redis\"] ,\"value\": 0.9444444444444445 },{\"source\": [\"redis\"] ,\"target\": [\"java\"] ,\"value\": 0.5151515151515151 },{\"source\": [\"redis\"] ,\"target\": [\"mysql\"] ,\"value\": 0.7083333333333334 },{\"source\": [\"mysql\"] ,\"target\": [\"redis\"] ,\"value\": 0.9444444444444445 },{\"source\": [\"redis\"] ,\"target\": [\"mybatis\"] ,\"value\": 0.6428571428571429 },{\"source\": [\"mybatis\"] ,\"target\": [\"redis\"] ,\"value\": 0.5 },{\"source\": [\"springcloud\"] ,\"target\": [\"mysql\"] ,\"value\": 0.375 },{\"source\": [\"mysql\"] ,\"target\": [\"springcloud\"] ,\"value\": 0.8181818181818181 },{\"source\": [\"oracle\"] ,\"target\": [\"redis\"] ,\"value\": 0.4444444444444444 },{\"source\": [\"redis\"] ,\"target\": [\"oracle\"] ,\"value\": 0.47058823529411764 },{\"source\": [\"springboot\"] ,\"target\": [\"redis\"] ,\"value\": 0.4444444444444444 },{\"source\": [\"redis\"] ,\"target\": [\"springboot\"] ,\"value\": 0.6666666666666666 },{\"source\": [\"springboot\"] ,\"target\": [\"springcloud\"] ,\"value\": 0.8181818181818181 },{\"source\": [\"springcloud\"] ,\"target\": [\"springboot\"] ,\"value\": 0.75 },{\"source\": [\"springcloud\"] ,\"target\": [\"redis\"] ,\"value\": 0.4444444444444444 },{\"source\": [\"redis\"] ,\"target\": [\"springcloud\"] ,\"value\": 0.7272727272727272 },{\"source\": [\"java\"] ,\"target\": [\"springcloud\"] ,\"value\": 0.909090909090909 },{\"source\": [\"springcloud\"] ,\"target\": [\"java\"] ,\"value\": 0.303030303030303 },{\"source\": [\"java\"] ,\"target\": [\"dubbo\"] ,\"value\": 1.0 },{\"source\": [\"linux\"] ,\"target\": [\"mysql\"] ,\"value\": 0.375 },{\"source\": [\"mysql\"] ,\"target\": [\"linux\"] ,\"value\": 0.75 },{\"source\": [\"redis\"] ,\"target\": [\"linux\"] ,\"value\": 0.8333333333333334 },{\"source\": [\"linux\"] ,\"target\": [\"redis\"] ,\"value\": 0.5555555555555556 },{\"source\": [\"java\"] ,\"target\": [\"mybatis\", \"mysql\"] ,\"value\": 0.8888888888888888 },{\"source\": [\"mysql\"] ,\"target\": [\"java\", \"mybatis\"] ,\"value\": 0.6153846153846153 },{\"source\": [\"mybatis\"] ,\"target\": [\"java\", \"mysql\"] ,\"value\": 0.3636363636363636 },{\"source\": [\"java\", \"mysql\"] ,\"target\": [\"mybatis\"] ,\"value\": 0.5714285714285714 },{\"source\": [\"java\", \"mybatis\"] ,\"target\": [\"mysql\"] ,\"value\": 0.3333333333333333 },{\"source\": [\"java\"] ,\"target\": [\"oracle\", \"mysql\"] ,\"value\": 0.9285714285714286 },{\"source\": [\"oracle\"] ,\"target\": [\"java\", \"mysql\"] ,\"value\": 0.5909090909090909 },{\"source\": [\"mysql\"] ,\"target\": [\"java\", \"oracle\"] ,\"value\": 0.8125000000000001 },{\"source\": [\"java\", \"oracle\"] ,\"target\": [\"mysql\"] ,\"value\": 0.5416666666666667 },{\"source\": [\"java\", \"mysql\"] ,\"target\": [\"oracle\"] ,\"value\": 0.7647058823529412 },{\"source\": [\"oracle\", \"mysql\"] ,\"target\": [\"java\"] ,\"value\": 0.3939393939393939 },{\"source\": [\"java\"] ,\"target\": [\"springboot\", \"mysql\"] ,\"value\": 0.8888888888888888 },{\"source\": [\"springboot\"] ,\"target\": [\"java\", \"mysql\"] ,\"value\": 0.3636363636363636 },{\"source\": [\"mysql\"] ,\"target\": [\"java\", \"springboot\"] ,\"value\": 0.7272727272727272 },{\"source\": [\"java\", \"springboot\"] ,\"target\": [\"mysql\"] ,\"value\": 0.3333333333333333 },{\"source\": [\"java\", \"mysql\"] ,\"target\": [\"springboot\"] ,\"value\": 0.6666666666666666 },{\"source\": [\"java\"] ,\"target\": [\"redis\", \"mysql\"] ,\"value\": 0.9411764705882353 },{\"source\": [\"redis\"] ,\"target\": [\"java\", \"mysql\"] ,\"value\": 0.7272727272727272 },{\"source\": [\"mysql\"] ,\"target\": [\"java\", \"redis\"] ,\"value\": 0.9411764705882353 },{\"source\": [\"java\", \"redis\"] ,\"target\": [\"mysql\"] ,\"value\": 0.6666666666666666 },{\"source\": [\"java\", \"mysql\"] ,\"target\": [\"redis\"] ,\"value\": 0.8888888888888888 },{\"source\": [\"redis\", \"mysql\"] ,\"target\": [\"java\"] ,\"value\": 0.4848484848484848 },{\"source\": [\"mysql\"] ,\"target\": [\"redis\", \"mybatis\"] ,\"value\": 0.8888888888888888 },{\"source\": [\"redis\"] ,\"target\": [\"mybatis\", \"mysql\"] ,\"value\": 0.8888888888888888 },{\"source\": [\"mybatis\"] ,\"target\": [\"redis\", \"mysql\"] ,\"value\": 0.47058823529411764 },{\"source\": [\"redis\", \"mysql\"] ,\"target\": [\"mybatis\"] ,\"value\": 0.5714285714285714 },{\"source\": [\"mybatis\", \"mysql\"] ,\"target\": [\"redis\"] ,\"value\": 0.4444444444444444 },{\"source\": [\"redis\", \"mybatis\"] ,\"target\": [\"mysql\"] ,\"value\": 0.3333333333333333 },{\"source\": [\"oracle\"] ,\"target\": [\"redis\", \"mysql\"] ,\"value\": 0.47058823529411764 },{\"source\": [\"redis\"] ,\"target\": [\"oracle\", \"mysql\"] ,\"value\": 0.5714285714285714 },{\"source\": [\"mysql\"] ,\"target\": [\"oracle\", \"redis\"] ,\"value\": 1.0 },{\"source\": [\"oracle\", \"redis\"] ,\"target\": [\"mysql\"] ,\"value\": 0.3333333333333333 },{\"source\": [\"oracle\", \"mysql\"] ,\"target\": [\"redis\"] ,\"value\": 0.4444444444444444 },{\"source\": [\"redis\", \"mysql\"] ,\"target\": [\"oracle\"] ,\"value\": 0.47058823529411764 },{\"source\": [\"springcloud\"] ,\"target\": [\"redis\", \"mysql\"] ,\"value\": 0.47058823529411764 },{\"source\": [\"redis\"] ,\"target\": [\"springcloud\", \"mysql\"] ,\"value\": 0.8888888888888888 },{\"source\": [\"mysql\"] ,\"target\": [\"springcloud\", \"redis\"] ,\"value\": 1.0 },{\"source\": [\"springcloud\", \"redis\"] ,\"target\": [\"mysql\"] ,\"value\": 0.3333333333333333 },{\"source\": [\"springcloud\", \"mysql\"] ,\"target\": [\"redis\"] ,\"value\": 0.4444444444444444 },{\"source\": [\"redis\", \"mysql\"] ,\"target\": [\"springcloud\"] ,\"value\": 0.7272727272727272 },{\"source\": [\"java\"] ,\"target\": [\"springcloud\", \"mysql\"] ,\"value\": 0.8888888888888888 },{\"source\": [\"springcloud\"] ,\"target\": [\"java\", \"mysql\"] ,\"value\": 0.3636363636363636 },{\"source\": [\"mysql\"] ,\"target\": [\"java\", \"springcloud\"] ,\"value\": 0.8 },{\"source\": [\"java\", \"springcloud\"] ,\"target\": [\"mysql\"] ,\"value\": 0.3333333333333333 },{\"source\": [\"java\", \"mysql\"] ,\"target\": [\"springcloud\"] ,\"value\": 0.7272727272727272 },{\"source\": [\"java\"] ,\"target\": [\"springboot\", \"springcloud\"] ,\"value\": 0.8888888888888888 },{\"source\": [\"springboot\"] ,\"target\": [\"java\", \"springcloud\"] ,\"value\": 0.8 },{\"source\": [\"springcloud\"] ,\"target\": [\"java\", \"springboot\"] ,\"value\": 0.7272727272727272 },{\"source\": [\"java\", \"springboot\"] ,\"target\": [\"springcloud\"] ,\"value\": 0.7272727272727272 },{\"source\": [\"java\", \"springcloud\"] ,\"target\": [\"springboot\"] ,\"value\": 0.6666666666666666 },{\"source\": [\"java\"] ,\"target\": [\"redis\", \"mybatis\"] ,\"value\": 0.8888888888888888 },{\"source\": [\"redis\"] ,\"target\": [\"java\", \"mybatis\"] ,\"value\": 0.6153846153846153 },{\"source\": [\"mybatis\"] ,\"target\": [\"java\", \"redis\"] ,\"value\": 0.47058823529411764 },{\"source\": [\"java\", \"redis\"] ,\"target\": [\"mybatis\"] ,\"value\": 0.5714285714285714 },{\"source\": [\"java\", \"mybatis\"] ,\"target\": [\"redis\"] ,\"value\": 0.4444444444444444 },{\"source\": [\"java\"] ,\"target\": [\"mysql\", \"linux\"] ,\"value\": 1.0 },{\"source\": [\"linux\"] ,\"target\": [\"java\", \"mysql\"] ,\"value\": 0.40909090909090906 },{\"source\": [\"mysql\"] ,\"target\": [\"java\", \"linux\"] ,\"value\": 0.75 },{\"source\": [\"java\", \"linux\"] ,\"target\": [\"mysql\"] ,\"value\": 0.375 },{\"source\": [\"java\", \"mysql\"] ,\"target\": [\"linux\"] ,\"value\": 0.75 },{\"source\": [\"java\"] ,\"target\": [\"redis\", \"linux\"] ,\"value\": 1.0 },{\"source\": [\"redis\"] ,\"target\": [\"java\", \"linux\"] ,\"value\": 0.8333333333333334 },{\"source\": [\"linux\"] ,\"target\": [\"java\", \"redis\"] ,\"value\": 0.588235294117647 },{\"source\": [\"java\", \"redis\"] ,\"target\": [\"linux\"] ,\"value\": 0.8333333333333334 },{\"source\": [\"java\", \"linux\"] ,\"target\": [\"redis\"] ,\"value\": 0.5555555555555556 },{\"source\": [\"redis\", \"linux\"] ,\"target\": [\"java\"] ,\"value\": 0.303030303030303 },{\"source\": [\"redis\"] ,\"target\": [\"mysql\", \"linux\"] ,\"value\": 1.0 },{\"source\": [\"linux\"] ,\"target\": [\"redis\", \"mysql\"] ,\"value\": 0.5294117647058824 },{\"source\": [\"mysql\"] ,\"target\": [\"redis\", \"linux\"] ,\"value\": 0.9 },{\"source\": [\"redis\", \"linux\"] ,\"target\": [\"mysql\"] ,\"value\": 0.375 },{\"source\": [\"redis\", \"mysql\"] ,\"target\": [\"linux\"] ,\"value\": 0.75 },{\"source\": [\"mysql\", \"linux\"] ,\"target\": [\"redis\"] ,\"value\": 0.5 },{\"source\": [\"mysql\"] ,\"target\": [\"java\", \"redis\", \"linux\"] ,\"value\": 0.9 },{\"source\": [\"java\"] ,\"target\": [\"redis\", \"linux\", \"mysql\"] ,\"value\": 1.0 },{\"source\": [\"redis\"] ,\"target\": [\"java\", \"linux\", \"mysql\"] ,\"value\": 1.0 },{\"source\": [\"linux\"] ,\"target\": [\"java\", \"redis\", \"mysql\"] ,\"value\": 0.5625 },{\"source\": [\"java\", \"mysql\"] ,\"target\": [\"redis\", \"linux\"] ,\"value\": 0.9 },{\"source\": [\"redis\", \"mysql\"] ,\"target\": [\"java\", \"linux\"] ,\"value\": 0.75 },{\"source\": [\"linux\", \"mysql\"] ,\"target\": [\"java\", \"redis\"] ,\"value\": 0.5294117647058824 },{\"source\": [\"java\", \"redis\"] ,\"target\": [\"linux\", \"mysql\"] ,\"value\": 1.0 },{\"source\": [\"java\", \"linux\"] ,\"target\": [\"redis\", \"mysql\"] ,\"value\": 0.5294117647058824 },{\"source\": [\"redis\", \"linux\"] ,\"target\": [\"java\", \"mysql\"] ,\"value\": 0.40909090909090906 }]";
    @Autowired
    StringRedisTemplate redisTemplate;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        ClassPathResource city_info = new ClassPathResource("classpath:static/city_info.json");
        if (redisTemplate.opsForValue().get(AppRedisKey.FROZEN_SET) == null) {
            redisTemplate.opsForValue().set(AppRedisKey.FROZEN_SET, FrozenSet);
        }
        if (redisTemplate.opsForValue().get(AppRedisKey.POPULARITY) == null) {
            redisTemplate.opsForValue().set(AppRedisKey.POPULARITY,Popularity);
        }
        try {
            String s = IOUtils.toString(city_info.getStream(), String.valueOf(Charset.forName("UTF-8")));

            List<Province> province = JSON.parseArray(s, Province.class);
            for (int i = 0; i < province.size(); i++) {
                String provinceName = province.get(i).getName();
                List<City> cityList = province.get(i).getCityList();
                for (int j = 0; j < cityList.size(); j++) {
                    redisTemplate.opsForHash().putIfAbsent("city_info", cityList.get(j).getName(), provinceName);
                }
            }

        } catch (IOException e) {
            e.printStackTrace();
        }

    }


}
